<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>

<!DOCTYPE html>
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title><h:outputText value="#{msg.usl_home_title}" /></title>
            <link href="<% out.print(request.getContextPath());%>/resources/css/position.css" rel="stylesheet" type="text/css" />

        </head>
        <body>

            <jsp:include page="/pages/fragments/header.jsp" />


            <jsp:include page="/pages/fragments/uslMenu.jsp" />


            <section>  
                <h:form>
                    <rich:panel>
                        <f:facet name="header">
                            <h:outputText value="#{msg.procedura}"/>
                        </f:facet>
                        <rich:extendedDataTable id="idList" value="#{beanRichiamo.patientList}" var="entry" 
                                                selectionMode="multi">
                            
                            <rich:column sortBy="#{entry[0]}" label="#{msg.patient_name}" width="22%">
                                <f:facet name="header">
                                    <h:outputText value="#{msg.patient_name}"/>
                                </f:facet>
                                <h:outputText value="#{entry[0]}" />
                            </rich:column>

                            <rich:column sortBy="#{entry[1]}" label="#{msg.last_name}" width="22%">
                                <f:facet name="header">
                                    <h:outputText value="#{msg.last_name}"/>
                                </f:facet>
                                <h:outputText value="#{entry[1]}"/>
                            </rich:column>

                            <rich:column sortBy="#{entry[2]}" label="#{msg.ultima_saltata}" width="22%">
                                <f:facet name="header">
                                    <h:outputText value="#{msg.ultima_saltata}"/>
                                </f:facet>
                                <h:outputText value="#{entry[2]}">
                                    <f:convertDateTime pattern="#{msg.date_pattern}" />
                                </h:outputText>                                    
                            </rich:column>
                            
                            <rich:column sortBy="#{entry[3]}" label="#{msg.missed_count}" width="22%">
                                <f:facet name="header">
                                    <h:outputText value="#{msg.missed_count}"/>
                                </f:facet>
                                <h:outputText value="#{entry[3]}" />                               
                            </rich:column>

                            <rich:column  width="12%">
                                <f:facet name="header">
                                        <h:outputText value="#{msg.checked}"/>
                                </f:facet>
                                <h:selectBooleanCheckbox id="checkEntry" value="#{beanRichiamo.selectedListTmp[entry]}"  disabled="false"/>
                            </rich:column> 
                        </rich:extendedDataTable>


                        <h:commandButton value="#{msg.send_notifications}" action="#{beanRichiamo.richiamaAssenti()}" />

                    </rich:panel>
                </h:form>

            </section>






        </body>
    </html>
</f:view>
